Avoid moving focus when changing iframe remoteness. Differential Revision: https://phabricator.services.mozilla.com/D99215 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1663931 gecko-commit: c63ecdad6a3c60ba625517d34bb29c8aae9f5e95 gecko-reviewers: nika, mccr8
diff --git a/focus/activeelement-after-immediately-focusing-different-site-iframe-contentwindow.html b/focus/activeelement-after-immediately-focusing-different-site-iframe-contentwindow.html index 4cb3c68..8c3a9d1 100644 --- a/focus/activeelement-after-immediately-focusing-different-site-iframe-contentwindow.html +++ b/focus/activeelement-after-immediately-focusing-different-site-iframe-contentwindow.html
@@ -6,19 +6,8 @@ <script> setup({explicit_done:true}); window.onmessage = function(e) { - var actual = e.data; test(function() { - // Make the difference between Firefox and Chrome visible separately - // from the comparison of the entire log string failing to match. - var endedWith = false; - if (actual.endsWith(",willspineventloop,")) { - endedWith = true; - actual += "innerbodyfocus,"; - } - assert_true(endedWith, "Should not have gotten innerbodyfocus after willspineventloop"); - }, "Check trailing events"); - test(function() { - assert_equals(actual, "outerparser,activeElement:BODY,willfocusiframe,didfocusiframe,activeElement:IFRAME,willbluriframe,didbluriframe,activeElement:IFRAME,willspineventloop,innerbodyfocus,", 'Check log'); + assert_equals(e.data, "outerparser,activeElement:BODY,willfocusiframe,didfocusiframe,activeElement:IFRAME,willbluriframe,didbluriframe,activeElement:IFRAME,willspineventloop,", 'Check log'); }, "Check result"); w.close(); done(); diff --git a/focus/activeelement-after-immediately-focusing-same-site-iframe-contentwindow.html b/focus/activeelement-after-immediately-focusing-same-site-iframe-contentwindow.html index 81dbfd2..2f6a8ac 100644 --- a/focus/activeelement-after-immediately-focusing-same-site-iframe-contentwindow.html +++ b/focus/activeelement-after-immediately-focusing-same-site-iframe-contentwindow.html
@@ -6,19 +6,8 @@ <script> setup({explicit_done:true}); window.onmessage = function(e) { - var actual = e.data; test(function() { - // Make the difference between Firefox and Chrome visible separately - // from the comparison of the entire log string failing to match. - var endedWith = false; - if (actual.endsWith(",willspineventloop,")) { - endedWith = true; - actual += "innerbodyfocus,"; - } - assert_true(endedWith, "Should not have gotten innerbodyfocus after willspineventloop"); - }, "Check trailing events"); - test(function() { - assert_equals(actual, "outerparse,activeElement:BODY,willfocusiframe,didfocusiframe,activeElement:IFRAME,willbluriframe,didbluriframe,activeElement:IFRAME,willspineventloop,innerbodyfocus,", 'Check log'); + assert_equals(e.data, "outerparse,activeElement:BODY,willfocusiframe,didfocusiframe,activeElement:IFRAME,willbluriframe,didbluriframe,activeElement:IFRAME,willspineventloop,", 'Check log'); }, "Check result"); w.close(); done(); diff --git a/focus/support/activeelement-after-immediately-focusing-different-site-iframe-inner-contentwindow.html b/focus/support/activeelement-after-immediately-focusing-different-site-iframe-inner-contentwindow.html index bc78e6e..7d47e7e 100644 --- a/focus/support/activeelement-after-immediately-focusing-different-site-iframe-inner-contentwindow.html +++ b/focus/support/activeelement-after-immediately-focusing-different-site-iframe-inner-contentwindow.html
@@ -8,7 +8,9 @@ <h1>Inner</h1> <script> document.body.onfocus = function() { - parent.postMessage("innerbodyfocus,", "*"); + // Commented out pending resolution of + // https://github.com/whatwg/html/issues/6209 + // parent.postMessage("innerbodyfocus,", "*"); } document.body.onblur = function() { parent.postMessage("innerbodyblur,", "*"); diff --git a/focus/support/activeelement-after-immediately-focusing-same-site-iframe-inner-contentwindow.html b/focus/support/activeelement-after-immediately-focusing-same-site-iframe-inner-contentwindow.html index bc78e6e..7d47e7e 100644 --- a/focus/support/activeelement-after-immediately-focusing-same-site-iframe-inner-contentwindow.html +++ b/focus/support/activeelement-after-immediately-focusing-same-site-iframe-inner-contentwindow.html
@@ -8,7 +8,9 @@ <h1>Inner</h1> <script> document.body.onfocus = function() { - parent.postMessage("innerbodyfocus,", "*"); + // Commented out pending resolution of + // https://github.com/whatwg/html/issues/6209 + // parent.postMessage("innerbodyfocus,", "*"); } document.body.onblur = function() { parent.postMessage("innerbodyblur,", "*");